Skip to content

style: adjust page indicator dot size in fullscreen mode#751

Merged
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-356945
Apr 21, 2026
Merged

style: adjust page indicator dot size in fullscreen mode#751
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-356945

Conversation

@wjyrich
Copy link
Copy Markdown
Contributor

@wjyrich wjyrich commented Apr 21, 2026

Changed the implicit width and height of page indicator dots from 10 to 8 pixels when not in windowed mode (i.e., in fullscreen mode). This reduces the visual size of the navigation dots slightly to create a more balanced and less intrusive appearance during fullscreen folder browsing.

The adjustment maintains the windowed mode size at 5 pixels while optimizing the fullscreen experience with slightly smaller dots that are still clearly visible but less dominant in the UI.

Log: Adjusted page indicator dot size in fullscreen folder view for better visual balance

Influence:

  1. Test folder navigation in both windowed and fullscreen modes
  2. Verify page indicator dots are visible and correctly sized in each mode
  3. Check that the current page indicator remains clearly distinguishable
  4. Ensure touch/click targets remain accessible
  5. Verify visual consistency across different screen resolutions
  6. Test with various folder content and page counts

style: 调整全屏模式下的页面指示点大小

将非窗口模式(即全屏模式)下的页面指示点的隐式宽度和高度从10像素调整为8
像素。这略微减小了导航点的视觉尺寸,在全屏文件夹浏览时创建更平衡且不那么
突兀的外观。

此调整保持窗口模式下的尺寸为5像素,同时通过略微减小但仍清晰可见的指示点
来优化全屏体验,使其在UI中不那么显眼。

Log: 调整全屏文件夹视图中的页面指示点大小以获得更好的视觉平衡

Influence:

  1. 测试窗口模式和全屏模式下的文件夹导航
  2. 验证页面指示点在每种模式下是否可见且尺寸正确
  3. 检查当前页面指示器是否保持清晰可辨
  4. 确保触摸/点击目标保持可访问性
  5. 验证不同屏幕分辨率下的视觉一致性
  6. 测试各种文件夹内容和页面数量

PMS: BUG-356945

Summary by Sourcery

Enhancements:

  • Reduce fullscreen page indicator dot size in FolderGridViewPopup to make navigation dots less visually dominant without affecting windowed mode behavior.

Changed the implicit width and height of page indicator dots from 10
to 8 pixels when not in windowed mode (i.e., in fullscreen mode). This
reduces the visual size of the navigation dots slightly to create a
more balanced and less intrusive appearance during fullscreen folder
browsing.

The adjustment maintains the windowed mode size at 5 pixels while
optimizing the fullscreen experience with slightly smaller dots that are
still clearly visible but less dominant in the UI.

Log: Adjusted page indicator dot size in fullscreen folder view for
better visual balance

Influence:
1. Test folder navigation in both windowed and fullscreen modes
2. Verify page indicator dots are visible and correctly sized in each
mode
3. Check that the current page indicator remains clearly distinguishable
4. Ensure touch/click targets remain accessible
5. Verify visual consistency across different screen resolutions
6. Test with various folder content and page counts

style: 调整全屏模式下的页面指示点大小

将非窗口模式(即全屏模式)下的页面指示点的隐式宽度和高度从10像素调整为8
像素。这略微减小了导航点的视觉尺寸,在全屏文件夹浏览时创建更平衡且不那么
突兀的外观。

此调整保持窗口模式下的尺寸为5像素,同时通过略微减小但仍清晰可见的指示点
来优化全屏体验,使其在UI中不那么显眼。

Log: 调整全屏文件夹视图中的页面指示点大小以获得更好的视觉平衡

Influence:
1. 测试窗口模式和全屏模式下的文件夹导航
2. 验证页面指示点在每种模式下是否可见且尺寸正确
3. 检查当前页面指示器是否保持清晰可辨
4. 确保触摸/点击目标保持可访问性
5. 验证不同屏幕分辨率下的视觉一致性
6. 测试各种文件夹内容和页面数量

PMS: BUG-356945
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 21, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the size of page indicator dots in fullscreen (non-windowed) mode within FolderGridViewPopup to make them slightly smaller while keeping windowed mode unchanged.

Flow diagram for page indicator dot sizing by mode

flowchart TD
  A[FolderGridViewPopup] --> B{isWindowedMode}
  B -- true --> C[Dot size
implicitWidth 5
implicitHeight 5]
  B -- false --> D[Dot size
implicitWidth 8
implicitHeight 8]
  A --> E[Dot spacing
isWindowedMode true: 5
isWindowedMode false: 10]
Loading

File-Level Changes

Change Details Files
Reduce fullscreen page indicator dot size while keeping windowed mode dots unchanged.
  • Update implicitWidth of the page indicator delegate to 5px in windowed mode and 8px in fullscreen mode instead of 10px
  • Update implicitHeight of the page indicator delegate to 5px in windowed mode and 8px in fullscreen mode instead of 10px
  • Retain existing spacing and visual styling (radius and color) for the indicators
qml/FolderGridViewPopup.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider extracting the page indicator dot size (and possibly spacing) into named properties or constants so the windowed/fullscreen sizes stay in sync and are easier to tweak in one place later.
  • Given that the spacing remains 10 while fullscreen dot size is reduced to 8, double-check whether the visual layout still looks balanced or whether spacing should scale with the dot size as well.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider extracting the page indicator dot size (and possibly spacing) into named properties or constants so the windowed/fullscreen sizes stay in sync and are easier to tweak in one place later.
- Given that the spacing remains 10 while fullscreen dot size is reduced to 8, double-check whether the visual layout still looks balanced or whether spacing should scale with the dot size as well.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

这段代码是一个 QML (Qt Modeling Language) 文件的差异片段,主要修改了 FolderGridViewPopup 中分页指示器(Page Indicator)的尺寸大小。

以下是对这段代码的详细审查和改进意见:

1. 语法逻辑审查

  • 现状:代码修改了 implicitWidthimplicitHeight 的值,从 isWindowedMode ? 5 : 10 变更为 isWindowedMode ? 5 : 8。语法上完全符合 QML 规范,三元运算符使用正确。
  • 逻辑:逻辑意图很明确:在非窗口模式下,将指示器的大小从 10px 缩小到 8px,而在窗口模式下保持 5px 不变。这通常是为了 UI 调整,可能是为了在非窗口模式下让指示器看起来更精致或节省空间。

2. 代码质量审查

  • 魔法数字:代码中使用了大量的硬编码数字(如 5, 8, 10, 0.9, 0.5, 0.2)。
    • 建议:如果这些尺寸和透明度值在应用的其他地方也会用到,或者需要根据主题动态调整,建议将它们提取到顶层的 property 中,或者由 C++ 后端/样式单控制。例如:
      // 在 Popup 或更上层的组件中定义
      readonly property int indicatorSizeWindowed: 5
      readonly property int indicatorSizeFullscreen: 8
      readonly property real indicatorOpacityActive: 0.9
      readonly property real indicatorOpacityPressed: 0.5
      readonly property real indicatorOpacityInactive: 0.2
      
      // 使用时
      implicitWidth: isWindowedMode ? indicatorSizeWindowed : indicatorSizeFullscreen
      implicitHeight: isWindowedMode ? indicatorSizeWindowed : indicatorSizeFullscreen
      color: Qt.rgba(255, 255, 255, index === folderPageIndicator.currentIndex ? indicatorOpacityActive : pressed ? indicatorOpacityPressed : indicatorOpacityInactive)
  • 颜色定义Qt.rgba(255, 255, 255, ...) 中的 RGB 值也是硬编码的。
    • 建议:建议使用 Qt.rgba(1, 1, 1, ...)(因为 rgba 接受 0.0-1.0 的浮点数,虽然传入 255 会被自动处理,但显式使用 0-1 范围更符合规范且意图更清晰),或者引用一个预定义的颜色属性,如 palette.text 或自定义的 style.indicatorColor

3. 代码性能审查

  • 现状:这部分代码位于 delegate 中,意味着每个指示器项都会执行这些绑定。虽然这里的计算量非常小,对性能影响微乎其微,但保持简洁总是好的。
  • 建议:当前的写法已经是 QML 中性能较好的写法(使用属性绑定而非 JavaScript 函数),无需特别的性能优化。

4. 代码安全审查

  • 除零风险:代码中包含 radius: width / 2
    • 分析:由于 implicitWidth 被硬编码为 5 或 8,且没有逻辑将其设置为 0,因此这里不存在除以零导致崩溃的风险。
    • 建议:尽管当前安全,但如果未来逻辑改为动态计算宽度,建议增加保护,例如 radius: width > 0 ? width / 2 : 0

5. 综合改进建议代码示例

结合上述建议,改进后的代码可能如下:

Popup {
    // 假设这些定义在组件的根层级或样式配置中
    readonly property int indicatorSizeWindowed: 5
    readonly property int indicatorSizeFullscreen: 8
    readonly property color indicatorColor: "white" // 或者使用 Qt.rgba(1, 1, 1, 1)

    // ... 其他代码 ...

    delegate: Rectangle {
        // 使用定义好的属性,提高可维护性
        implicitWidth: isWindowedMode ? indicatorSizeWindowed : indicatorSizeFullscreen
        implicitHeight: isWindowedMode ? indicatorSizeWindowed : indicatorSizeFullscreen

        // 安全的半径计算
        radius: width > 0 ? width / 2 : 0
        
        // 使用预定义颜色,并优化透明度逻辑的可读性
        color: {
            if (index === folderPageIndicator.currentIndex) 
                return Qt.rgba(indicatorColor.r, indicatorColor.g, indicatorColor.b, 0.9);
            if (pressed) 
                return Qt.rgba(indicatorColor.r, indicatorColor.g, indicatorColor.b, 0.5);
            return Qt.rgba(indicatorColor.r, indicatorColor.g, indicatorColor.b, 0.2);
        }
    }
}

总结
原代码修改本身是安全的,主要是 UI 布局的微调。主要的改进点在于消除魔法数字,将常量提取为属性,以便于后续的主题维护和全局修改。

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, Ivy233, wjyrich

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wjyrich wjyrich merged commit caca739 into linuxdeepin:master Apr 21, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants